/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xmltest;

import MyDatabase.*;
import MyGUI.*;
import javax.swing.JFrame;

/**
 *
 * @author Welcome
 */
public class XMLTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        MainJFrame mainJFrame = new MainJFrame();
        mainJFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
        mainJFrame.setVisible(true);
        //DatabaseHandler databaseHandler = new DatabaseHandler("D:\\Testdb.xml");
        //databaseHandler.showTest();
        //databaseHandler.WriteDatabase("D:\\abc.xml");
        /*
        try {
            // TODO code application logic here
            File xmlFile = new File("D:\\haudam1.xml");
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.parse(xmlFile);
            doc.getDocumentElement().normalize();
            //System.out.println(doc.getDocumentElement().getNodeName());
            //String dbName = doc.getDocumentElement().getNodeName();
            Element rootEle = doc.getDocumentElement();
            System.out.println("Root name "+rootEle.getNodeName());
            System.out.println("Name database "+rootEle.getAttribute("DBname"));
            
            NodeList listOfPersons = rootEle.getElementsByTagName("table");
             
            int totalPersons = listOfPersons.getLength();
            System.out.println("Total no of table : " + totalPersons);
            for(int i=0;i<totalPersons;i++)
            {
                Node tempNode=listOfPersons.item(i);
                if(tempNode.getNodeType()==Element.ELEMENT_NODE)
                {
                    Element tableElement = (Element)tempNode;
                    //System.out.println(tableElement.getAttribute("tableName"));
                    ProcessForTable(tableElement);
                }
            }
            
            
        } catch (Exception ex) {
           ex.printStackTrace();
        }
         * 
         */
    }

   
         
    
}
